Utiliser AppleScript avec OmniWeb
De nombreuses fonctions d'OmniWeb peuvent être pilotées par le langage d'automatisation d'AppleScript.
Pour un aperçu complet des objets scriptable dans OmniWeb, vous pouvez consulter son Dictionnaire AppleScript en glissant OmniWeb sur l'icône de l'Éditeur de scripts Apple. L'Éditeur de scripts est installé par défaut dans /Applications/AppleScript/.
Exemples
AppleScript
Ce script désolidarise tous les onglets d'une fenêtre et les place dans des fenêtres indépendantes.
tell application "OmniWeb"
set theBrowser to front browser
if (count tabs of theBrowser) > 1 then
repeat until (count tabs of theBrowser) = 1
set theTab to second tab of theBrowser
set theAddress to address of theTab
make new browser at end of browsers with properties {address:theAddress}
delete theTab
end repeat
end if
set has tabs of theBrowser to false
end tell
Celui-ci crée une fenêtre unique en plaçant toutes les fenêtre ouvertes dans ses onglets.
tell application "OmniWeb"
set mainBrowser to front browser
set frontID to id of front browser
set background to (every browser whose id is not frontID)
repeat with theBrowser in background
set theAddress to address of theBrowser
tell mainBrowser to make new tab at end of tabs with properties {address:theAddress}
close theBrowser
end repeat
end tell
Vous trouverez de nombreux autres AppleScripts pour OmniWeb dans la section "OmniWeb product pages" sur omnigroup.com.